Skip to content

fix(init): settle every choice before writing when stdin isn't a terminal - #949

Merged
cpojer merged 1 commit into
mainfrom
fix/init-closed-stdin
Nov 28, 2026
Merged

cpojer merged 1 commit into
mainfrom
fix/init-closed-stdin

Conversation

@hyfdev

@hyfdev hyfdev commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

void init with stdin closed, as in CI or with < /dev/null, edits the project and then waits on a prompt that never resolves, so Node exits with code 13:

$ void init --toolchain vite --no-git --deploy none < /dev/null
…
  ↑/↓ navigate · Enter confirm
Warning: Detected unsettled top-level await at file:///…/node_modules/void/dist/cli/cli.mjs:87

▲ Setup did not finish. Files changed so far:
  + void.config.ts
  ~ tsconfig.json  extends .void/tsconfig.json, added void/env to types
  ~ .gitignore     added Void defaults

Clack never settles a prompt once its input ends (bombshell-dev/clack#615), and init asks for the database only after it has written these files.

Without a terminal, init now takes every choice from flags or the app's saved settings before it writes anything, and a missing one exits 1 with the flag to pass, so piped answers no longer pick them.

The demo, workflow and project link steps, and a Cloudflare sign-in or account choice it can't make, are skipped with a note on how to finish them later.

Runs in a terminal, and with --tsconfig or --github, write the same files as before, except that --git or --no-git inside a workspace package, where they aren't available, now fails before init changes any files.

Fixes #953

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-init-closed-stdin-void-cloud.voidzero-docs.workers.dev (commit d12561a)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://4a7367a0-void-cloud.voidzero-docs.workers.dev d12561a 2026-11-28T07:46:29.285Z Visit the dashboard ↗

@hyfdev
hyfdev marked this pull request as ready for review November 28, 2026 07:59
Copilot AI balanced review requested due to automatic review settings November 28, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix!

@cpojer
cpojer merged commit 6707550 into main Nov 28, 2026
22 checks passed
@cpojer
cpojer deleted the fix/init-closed-stdin branch November 28, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

void init changes files and then exits 13 when stdin is closed

3 participants